package com.zero.yygh.task.scheduled;

import com.zero.yygh.common.constant.MqConst;
import com.zero.yygh.common.service.RabbitService;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author zero
 * @desc 定时任务
 * @create 2021/5/12
 */
@Component
@EnableScheduling
public class ScheduledTask {

    @Resource
    private RabbitService rabbitService;

    /**
     * 每天指定时间,就医提醒
     * @author zero
     * @date 2021/5/12 13:48 
     */
    @Scheduled(cron = "0/30 * * * * ?")
    public void taskPatient() {
        rabbitService.sendMessage(MqConst.EXCHANGE_DIRECT_TASK, MqConst.ROUTING_TASK_8, "");
    }

}
